UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aLr4nwBmqr8/KOxvUbFQ36qMDYxB/7nn68FXgnbD8Hc='
WHERE
key_id = '262a20c886c0e944e098b8cbf1b36ebf1a8b08577effa00413e812fec5931fda'
AND (
token = 'aLr4nwBmqr8/KOxvUbFQ36qMDYxB/7nn68FXgnbD8Hc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)