INSERT INTO component_cc (SELECT '<user id>' as user_id, component_id FROM component_cc JOIN components ON component_cc.component_id = components.id WHERE components.product_id = <product id>)
some foobar
INSERT INTO component_cc (SELECT '<user id>' as user_id, component_id FROM component_cc JOIN components ON component_cc.component_id = components.id WHERE components.product_id = <product id>)