Luboos has already explained that even at threshold the products are produced at rest only in the Center of Momentum frame of the initial system, but this is a nice problem to demonstrate the power of calculating with relativistic invariants.
To find the threshold is a naive way, we could calculate the velocity of the center of momentum frame as a function of the beam energy, then boost both beam and target into that frame and calculate the total energy. It is not a particularly difficult task.
But we can do better than that.
The total four-momentum vector of the products at threshold, in the CoM from is
$$ \mathbf{P} = \mathbf{p}_C + \mathbf{p}_D = (m_C,\vec{0}) + (m_D,\vec{0}) $$
and squaring that we obtain the (relativisticly invariant) mass of the system at threshold:
$$ M_f = (m_C + m_D, \vec{0})^2 = m_C^2 + 2 m_C m_D + m_D^2 $$
We can calculate the same quantity for the precursors in the lab frame of reference:
$$ \mathbf{p}_A = (E_A,\vec{p}_A) \approx (p_A, \vec{p}_A) $$
$$ \mathbf{p}_B = (E_B,\vec{p}_B) = (m_B, \vec{0}) $$
where I have assumed that the beam is fully relativistic (hey, I spent a lot of time at an electron accelerator facility). This makes the mass squared of the initial system
$$ M_i = (p_A + m_b, \vec{p}_A) = (p_A^2 + 2 p_A m_B + m_B^2) - p_A^2 $$
which we simplify and set equal to the mass squared of the final products to find the beam momentum needed for threshold production:
$$ p_{A,\text{threshold}} = \frac{ (m_C + m_D)^2 - m_B^2}{2 m_b} $$
One half of this calculation was done in the CoM frame and the other half in the lab frame, but because I only compared Lorentz invariant quantities I was able to combine them with impunity.