UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9BWWx7MBpjTX+FPedBz7ipFGg4PfQC25hQEftWwDaNQ='
WHERE
key_id = 'de3097c4d498142c1edc73de9305463f55cd8b185be491b5fc47953269bcc1d4'
AND (
token = '9BWWx7MBpjTX+FPedBz7ipFGg4PfQC25hQEftWwDaNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)