refactored lock query timeout in xml.php