Coffee warmer capsule
Newtons Law of Cooling - Scala graduum caloris


  the heat which hot iron, in a determinate time, communicates to cold
  bodies near it, that is, the heat which the iron loses in a certain
  time is as the whole heat of the iron; and therefore, if equal time of cooling be taken, the degrees of heat will be
  in geometrical proportion


\$ \frac{dQ}{dt} = h\cdot A \cdot \Delta T(t)\$

Q = Thermal Energy (cooling rate)

h = Heat transfer coef - Taking a minimum of 3Wm-2K-1 [1]

A = Heat transfer area - \$\pi r^2\$, take a 8cm diameter mug = 0.02m2

\$\Delta T\$ = Temperature of the object - Ambient temperature = 50 - 22 = 28

Thus the cooling rate is: 3 * 0.02 * 28 = 1.68W

This is what you need to counter. So you need a resistor to transfer 1.68Watts. 

Take a typical AA battery: 1.5V @ 3.9Wh (typical Alkaline). This potentially could source the needed energy for your required 1-2h (2.32h).

From \$P = \frac{V^2}{R}\$ R would therefore need to be: \$1.339\Omega\$, but this equates to 1.12A CONTINUOUSLY from a AA, which it will not do (50mA is a typical drain) 

This should show you the methodology needed &amp; its a simple case of finding a suitable battery, suitable resistor, for the given environment.

[1] http://www.engineeringtoolbox.com/convective-heat-transfer-d_430.html