Database query to manually update db_version on all sites

Fellow pirates!

Could somebody help me to a query to change (update actually) the db_version in option_name for each site in the database? Somehow the wp versions get updated but the database versions are stuck at 3.6 (24448, should be 27916 since I'm running 3.9.2) I suspect this is slowing down the backends of the sites. Much obliged and ARRRRH mateys!

Nick