Of course China is in for their own interests. They will keep things friendly enough with Russia, because they themselves are eyeing Taiwan and other goals in their sphere of influence. They will need that UN veto and someone to watch their back when they will inevitably decide to go for it.
They also assuredly would like to create some sort of counter alliance to give West a pause and entice others to join and Russia is an important piece in that.
Now, that's not to say they are happy about the whole mess - I am sure CCP is not exactly happy about Putin starting this, simply because it's both way too soon and because inadvertently it put the West into consolidation and preparation mode ahead of schedule.
So right now China is forced to try to walk the fine line of neutrality-ish on the whole thing. They are not quite ready yet for their own BS. On the other hand I have no doubt China will give a hand to Russia if things are dire, because they have no interest in Russian regime collapse or worse some sort of coup or course reversal happening that would align Russia with the West (or at least chill it the fuck down).