UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GEN6jp+3Frla4w85ZVkrTTffJKDIu6KCMCEzGNS/zk0='
WHERE
key_id = '451370f9c7b73f01a56ede87b2fbf0c19f03f973c83677d57b138625dabc71ad'
AND (
token = 'GEN6jp+3Frla4w85ZVkrTTffJKDIu6KCMCEzGNS/zk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)