UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Fstr+vwiwkNVvmtgODAZcSeeRrOFuOmPy3mlEZHItE=' 
WHERE 
  key_id = '110c3f6ea102b36a1634f1ed8d3a72a01d00c9efe53cbf4cfb9d0100119bc740' 
  AND (
    token = '0Fstr+vwiwkNVvmtgODAZcSeeRrOFuOmPy3mlEZHItE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046