Recent experiments in the cuprates have seen evidence of a transient superconducting state upon optical excitation polarized along the c axis [R. Mankowsky et al., Nature (London) 516, 71 (2014)]. Motivated by these experiments, we propose an extension of the single-layer $t−J−V$ model of cuprates to three dimensions in order to study the effects of interplane tunneling on the competition between superconductivity and bond density wave order. We find that an optical pump can suppress the charge order and simultaneously enhance superconductivity, due to the inherent competition between the two. We also provide an intuitive picture of the physical mechanism underlying this effect. Furthermore, based on a simple Floquet theory, we estimate the magnitude of the enhancement.