We consider the quantum Rabi model with external time modulation of the atomic frequency, which can be employed to create excitations from the vacuum state of the electromagnetic field as a consequence of the dynamical Casimir effect. Excitations can also be systematically subtracted from the atom-field system by suitably adjusting the modulation frequency, in the so-called anti-dynamical Casimir effect (ADCE). We evaluate the quantum thermodynamical work and show that a realistic out-of-equilibrium finite-time protocol harnessing ADCE allows for work extraction from the system, whose amount can be much bigger then the modulation amplitude, $| W_{mathrm{ADCE}}| gg hbar epsilon_Omega$, in contrast to the case of very slow adiabatic modulations. We provide means to control work extraction in state-of-the-art experimental scenarios, where precise frequency adjustments or complete system isolation may be difficult to attain.