UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDWTNF2910OOkr9z5FY1Z3lwjjCJSRpFRB8qd6nq41M='
WHERE
key_id = '04a47c8d9ec21248c531f53291038f5299928cb5be46f57d0a7ccb12f9fdc6bc'
AND (
token = 'RDWTNF2910OOkr9z5FY1Z3lwjjCJSRpFRB8qd6nq41M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)