UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3dzYKRQxhralIBauhF1+ftYZjgzfOBhAETF+Mty6o0o='
WHERE
key_id = '9271405e8caa9c23cd0c3a7240c746adfad3138f4e64dfed92d1abe8aa73854f'
AND (
token = '3dzYKRQxhralIBauhF1+ftYZjgzfOBhAETF+Mty6o0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)