UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '900pYoUGFWor5ZITdf00tbQRcR/nD6I05rGHd5F57fw='
WHERE
key_id = '79f394294232274269d7f94534bf04942655505effc1fb97096e494b44582e37'
AND (
token = '900pYoUGFWor5ZITdf00tbQRcR/nD6I05rGHd5F57fw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)