It is most likely the Camshaft seals that have to be replaced (Vanos, not the soleinoids
)
https://www.realoem.com/bmw/enUS/sho...diagId=11_3750
Look at item #2.
These seals were made out of metal and they used to cause so many ticking problems, bmw upgraded them to teflon ones.
When they are bad, they won’t allow enough oil to go to the valve timing gears, hence the ticking noise and when the oil is warm enough it gets passed them and oils up the timing gears and the noise disappears.
You can watch this for more details
Easy fix