UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'voGFH04QRhF4QrWBRAGUKYy9ai2D5PYj8OuH9CXhFV4='
WHERE
key_id = '3fb2cbd238ffa7240bc033f6e6c507ce33cbbfbf0c331c60b7aeff038171db23'
AND (
token = 'voGFH04QRhF4QrWBRAGUKYy9ai2D5PYj8OuH9CXhFV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)