You are, perhaps, over-thinking things.
If you are out of shape, then you will need to work up to higher cadences in higher gears without having your heart racing along.
Lower your gears, and enjoy your ride. Fitness will come when you get those miles behind you.