Dual-supply is a very common problem, and thus, you might simply have a look at the circuitry that selects power sources on commercial devices to get inspiration.
Note that microcontrollers with RTC often have a separate V_bat pin that allows a buffer coin cell to be used to run the RTC when main power is down. I recommend checking that you don't have that prior to considering working on a power switch.
You can usually build such power selection circuitry out of a few discrete semiconductors and resistors – however, considering you sound like you're designing for manufacture, it's probably easier AND more cost-efficient to use a specialized IC for that. Every major IC manufacturer (TI, ST, Maxim, NXP/Qualcomm, Linear, ON Semi, …) has a "power management" category.
What I've used is an LTC4412 – the datasheet has good example application circuits. I don't know if it's for 3.3V, but you should check the datasheet to learn what kind of device you're looking for. You'd probably want the LTC4411, which includes the switch in the IC itself, and is about USD1.90 in quantities of 100.
Note that you'll definitely need to know whether you're running off battery or grid power in your software – a coin cell really has not that much energy, and you'd want to avoid doing too much communication in order to make it last as long as possible.