UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VSnYT2WnNp6hpw4sOrwJW9+CfHY4gpJhRwro0YHaLEo='
WHERE
key_id = '65504f08fc4f1f7cbe859cb75081a0db5dc9eeeae956da97f84a9c25dae8a1f6'
AND (
token = 'VSnYT2WnNp6hpw4sOrwJW9+CfHY4gpJhRwro0YHaLEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)