As I suspected, it looks like my model above holds true; you first INSERT a row into "Orders" containing basic information about the order and also generating an "OrderNumber" at that time.
Assuming that you correctly set either a PRIMARY or UNIQUE KEY on the "OrderNumber" and "ProductID" columns, all you need to do is utilize the "ON DUPLICATE KEY UPDATE" syntax above to update Qty=Qty+1 when a duplication occurs.
EDIT: In other words, you get rid of the UPDATE query you're doing and simply execute the same INSERT query you already have with the addition of the "ON DUPLICATE KEY UPDATE" syntax tacked onto the end of it.