I did it with two down bags.
Since your 40 deg bag is synthetic, you may want to use it inside the down bag, if there is room.
The weight from the 40 deg synthetic laying over the down bag could compress the down enough to negate some of the down's insulation.
In my case, one bag was tighter that the other, so when I layered the tighter one on the inside and the looser on the outside, it didn't cause much in the way of down compression.
I use my 40 deg bag in the hot summer, the 30 deg bag fall and spring, and the layered bags in the early and late winter as needed. I will sometimes substitute puffy down clothing instead of the 40 deg bag depending.