UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ucY1IfLPZjjaFbJuIsEIm4qJxkdEGKQw7k61WxZct4='
WHERE
key_id = '35cd6c79ab4380942eb08c106e7403d2600c88db4ccfcc32505a68f753531d4d'
AND (
token = '6ucY1IfLPZjjaFbJuIsEIm4qJxkdEGKQw7k61WxZct4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)