UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R9MV7+h22pqcYX0XgwawH2zP9wjH0lLccMCCfif9O2o=' 
WHERE 
  key_id = 'cea40e0d03dd7bd79585937163facca612ff0e3a3fc31351be17d5e69c001ee1' 
  AND (
    token = 'R9MV7+h22pqcYX0XgwawH2zP9wjH0lLccMCCfif9O2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047