UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QA7cy7r0jcSMTQ6QJx6ZTzkHZNOiXPlMmUTvy5giLMU='
WHERE
key_id = '4c108ab5267161fda6687ffe7c8a68e83578c33d0a0a268cc05e140b5955a7c7'
AND (
token = 'QA7cy7r0jcSMTQ6QJx6ZTzkHZNOiXPlMmUTvy5giLMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)