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