You can execute raw MySQL queries like this:
Code:
$tablePrefix = \XLite::getInstance()->getOptions(array('database_details', 'table_prefix'));
$query = 'UPDATE ' . $tablePrefix . 'orders SET lastVisitDate = 0 WHERE status = "T"';
\XLite\Core\Database::getEM()->getConnection()->executeQuery($query, array());
You should not use this for X-Cart 5 database tables (and use ORM instead), but it is OK to use this for non-X-Cart-5 tables in the same database.