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

Query time 0.00027