A large fraction of γ-ray bursts (GRBs) show a plateau phase during the X-ray afterglow emission, which has a physical origin that is still debated. In this work, we select a sample of 30 GRBs with simultaneous X-ray and optical data during and after the plateau phase. Through a time-resolved spectral analysis of the X-ray plateaus, we test the consistency of the unabsorbed optical fluxes with those obtained via X-ray-to-optical spectral extrapolation by assuming a synchrotron spectrum. By combining X-ray with optical data, we find that 63% (19/30) of GRBs are compatible with a single synchrotron spectrum, thus suggesting that both the optical and X-ray radiations are produced from a single emitting region. For these GRBs, we derive the temporal evolution of the break frequency, and we compare it with the expectations predicted by several models. For 11 of the 30 GRBs, the optical emission is above the predicted range of values extrapolated from the X-rays in at least one temporal bin of the light curve. These 11 GRBs may not be explained with a single-zone emission, indicating the necessity of invoking two co-operating processes in order to explain the broad-band spectral behaviour. We discuss our findings in the framework of different scenarios that are invoked to explain the plateau feature, including the energy injection from a spinning-down magnetar and the high latitude emission from a structured jet.