UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Ut6FLYuYXlpus2g6kXjrTVBTOnP2XUOuWYY4TZ1kc8='
WHERE
key_id = 'ce3d31b338a4bb46cede0a414d0e75c8425f137ba4732de0c07a0748713fec0f'
AND (
token = '7Ut6FLYuYXlpus2g6kXjrTVBTOnP2XUOuWYY4TZ1kc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)