UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f1CQpY7ZIinK5MoDpO57S9NbPbAK/FShipUh30dKInU='
WHERE
key_id = 'b5f498e8f0549b30b7d90c8fad90ead53edbd5117af4f897f874a55c6f52d7aa'
AND (
token = 'f1CQpY7ZIinK5MoDpO57S9NbPbAK/FShipUh30dKInU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)