UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yxpdtkYYfNCrWvaosshBwkPjZAGtAGq849Xe3FgP65Y='
WHERE
key_id = '6f7dafb08c500f482c95b1b306ed96fdd4986e9cc46948ff32e48b04b87d5905'
AND (
token = 'yxpdtkYYfNCrWvaosshBwkPjZAGtAGq849Xe3FgP65Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)