UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qidvdE3FDY3fBNRlG/wPfIsfTm8gvyfBETUMiE7Ygyc='
WHERE
key_id = '2276a7fd598fd1a3b1dad10ed12803830a243479db095eed20c45135cc4f0aac'
AND (
token = 'qidvdE3FDY3fBNRlG/wPfIsfTm8gvyfBETUMiE7Ygyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)