UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TUS1HFAa6pQ2veHFTyyLmGMa5M9FqEdiOD3BxepgFHc='
WHERE
key_id = '688cff27b5ea0496f1fdd3c98656445d8acc283024fa52ceceff5c83a959aa3a'
AND (
token = 'TUS1HFAa6pQ2veHFTyyLmGMa5M9FqEdiOD3BxepgFHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)