Create a temporary table called temp with 2 columns, increment_id and status.
Populate this table with orders numbers that need to be updated and the new status eg canceled.
Status values can be found at:-
SELECT *
FROM `sales_order_status_state`
These queries will then update the sales order and the order grid with the new status.
UPDATE `sales_flat_order`, temp
SET sales_flat_order.state = temp.status, sales_flat_order.state = temp.status
WHERE sales_flat_order.increment_id = temp.increment_id;
UPDATE `sales_flat_order_grid`, temp
SET sales_flat_order_grid.status = temp.status
WHERE sales_flat_order_grid.increment_id = temp.increment_id