UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dwncabDwRkIFxC7pchGpqYI9I0wrmSKVHtAxjPq1V4k='
WHERE
key_id = '61bd1eeb03f8108d3cf006965fdff86dbf123bcb80da6bcbdc9548268f20bcda'
AND (
token = 'dwncabDwRkIFxC7pchGpqYI9I0wrmSKVHtAxjPq1V4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)