Consider one of the two γ -rays. From Lorentz transformation
cpx = γc(cpx∗ + βcE∗)
where the energy and momentum refer to one of the two γ -rays and the subscript C refers to π0. Starred quantities refer to the rest system of π0.
cp cosθ = γ (cp∗ cosθ∗ + βE∗)
where we have dropped *** the subscript C. But for γ -rays cp∗ = E∗ and cp = E, and because the two γ -rays share equal energy in the CMS, E∗ = mc2/2, where m is the rest mass of π◦.