UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6k5wdLMLUO64cPe6MuKSuLojMdb7dEQFgK8/30cZ5co='
WHERE
key_id = 'f3401c6282ec7a66ebb1d1fd245d0aa685c2ae668cdfb28da7629ad11ee44704'
AND (
token = '6k5wdLMLUO64cPe6MuKSuLojMdb7dEQFgK8/30cZ5co='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)