Try:
mydb.myitems.update_or_insert(mydb.myitems.itemNumber==int(row),
itemNumber=int(row), uniqueTitle=fileName)
If the first argument is a query, it simply selects the records to be updated (if any). You must still specify all of the field values that you want to insert/update.