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