On 4.1.8 the category information and the product information are seperated, and then connected with a join table called xcart_products_categories, so you have to add this table to the query and then tell the query not to show products in categoryid 274.
Try this:
Code:
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing],$sql_tbl[products_categories] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid AND $sql_tbl[products_categories].productid=$sql_tbl[products].productid AND $sql_tbl[products_categories].categoryid!='274' ORDER BY RAND() LIMIT 4;";