Cities do lower average speed significantly, but 30k in 3 hours is indeed very slow.
Hard to diagnose from afar, but I'd say take a look at shifting technique and pedaling cadence. It's actually not so easy at first to know when to shift and which gear is right (until it becomes second nature and you never think about it again.)
Pedaling speed should be viewed as somewhat of a constant (try to aim for 60rpm at first, maybe?), and your job is to pick the gear that feels comfortable for that cadence in a given situation.