UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VymNPax+r5J0TOz81jC6FL06RFOZwVYLW4Fwd1mxsHE='
WHERE
key_id = '6ff3024e22c8095af8b097f551b5e16c1e0cbfb76558e21c02de19250ed1a93d'
AND (
token = 'VymNPax+r5J0TOz81jC6FL06RFOZwVYLW4Fwd1mxsHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)