Varnish with flash point over 40 °C — safe on painted mugs when heated?
Honestly, you should be using glaze and not varnish.

I get that you're just trying to protect a painting outside the mug, but even if you just wash it by hand, a varnish is likely going to break down much, much faster (especially with heating it) than a food safe glaze which can be applied to the whole mug creating a seal to protect everything and can often be washed in the dishwasher and heated even in an oven if you so desire and it won't damage it.

The caveat is that it probably would need to be kiln fired, but considering the prevalence of paint-and-take ceramic shops nowadays, you can probably find one that'll let you pay a fee to glaze and fire it for you so you don't even have to buy the glaze for one project.