I have heard a simaly which give some insight around this question. It goes like this. Think about you have a big bag with black and white pebbles. The black pebbles are the bad "Karma" and white are the good "Karma" which you done in your fast. When you do an act of merit, you add one withe pebble to your bag. Add black pebble with unwholesome acts. 

So if you can fill the bag with lot of white pebble ( wholesome acts), there is a high chance that you would get a white pebble (Good karma) from your bag. In other words you import your good karma by doing the good acts. 

I think when it comes to kamma, the basic idea is "chetana" is the most important aspect. I hope you have heard the quote "chetanaham bhikkawe kamman wadami". So with the insincere actions, there can be some good karma from the action, but as the "chetana" is not pure, the power of kamma is less according to my understanding.