UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7XixO3UM2A094vMZq3SWPcBietLZ5NWvFxwNChSyhOw='
WHERE
key_id = '3d7582956d097e8641f97ed26a8a023a16b48c827200d0243ccef9dd20248ac2'
AND (
token = '7XixO3UM2A094vMZq3SWPcBietLZ5NWvFxwNChSyhOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)