UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QoHMqjOVaBwbV2tI2wslqEMIMtmmffBF61ag/Fgg+Ls='
WHERE
key_id = '95117056fc7c9ef8b07975a70027203cc0c1adfcee8e7b564c2578138e0cfdd1'
AND (
token = 'QoHMqjOVaBwbV2tI2wslqEMIMtmmffBF61ag/Fgg+Ls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)