Check your bag through and then you'll go through immigraton in BKK but pick up your bags in CNX and subsequently go through immigration.
You can also check in at CNX on your return for all segments and clear immigration there. It's often what I do and it's ridiculously easy.