We consider a Josephson junction formed by a quantum dot connected to two bulk superconductors in the presence of Coulomb interaction and coupling to both an electromagnetic environment and a finite density of electronic quasiparticles. In the limit of a large superconducting gap we obtain a Born-Markov description of the relevant Andreev bound-states dynamics. We calculate the current-phase relation and we find that the experimentally unavoidable presence of quasiparticles can dramatically modify the 0-π standard transition picture. We show that photon-assisted quasiparticle absorption allows the dynamic switching from the 0 to the π state and vice versa, washing out the 0-π transition predicted by purely thermodynamic arguments. Spectroscopic signatures of Andreev bound-states broadening are investigated by considering microwave irradiation.