UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wbhtoKb2HzwfKi/4neYbfZ/9L946pNvFHZGU3uD7krs='
WHERE
key_id = 'da7529e98ff4789b9a851cdbd933a45f01c272a1bed5482259548ca1c7d1a4ba'
AND (
token = 'wbhtoKb2HzwfKi/4neYbfZ/9L946pNvFHZGU3uD7krs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)