Isolated shaver sockets contain a transformer that can hum, but should be quiet in normal operation. The humming can be anything from loose mounting screws to an actual fault that could cause it to fail permanently. However, there is normally a switch that turns it off until a plug is inserted. If nothing is plugged, in, then it should probably be replaced on account of the switch if nothing else. If it does go quiet when the shaver is unplugged, it might just be worth checking that nothing obvious is vibrating (the magnetic field of the transformer can vibrate a metal back box, for example) before condemning it.