Unified dispersive approach to real and virtual photon-photon scattering at low energy