The oxygen in water has 2 lone pairs, a total of 4 electrons and yes two of oxygens electrons are participating in bonding with the two hydrogens. So when a water molecule picks up a hydrogen cation to form H3O+, there is 1 lone pair left over, the other formed a bond with the hydrogen cation. This is called a Lewis acid base reaction since it involves electron pairs; the water is donating an electron pair to the hydrogen cation.
And yes, something similar happens with OH-; it has three lone pairs that can be donated to an acceptor like a hydrogen cation or metal cation.