UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kinZ2WpEsXNq5nULnUfQBS3ikgOZsCWVFb2Yt3fJbS4='
WHERE
key_id = 'b8f1cb1b03326bec037b0c31af60c7bc7d2e525e879a9b6de0ddca9d1856b69f'
AND (
token = 'kinZ2WpEsXNq5nULnUfQBS3ikgOZsCWVFb2Yt3fJbS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)