UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q7Dj51fq9hkxf5qum4gCJGhjEKT/FWorOi4p5IeFPCg='
WHERE
key_id = '89490300f1845cfd196659a7888505cd6d0ec04b43598faf3edb73f0c1cf26bf'
AND (
token = 'Q7Dj51fq9hkxf5qum4gCJGhjEKT/FWorOi4p5IeFPCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)