I have about 300 grams of gold. If I want to pay Zakah what value should I take? If I am to buy such gold it will be SR42 per gram, but if I am selling, it will be SR32.

If you are speaking of a woman’s jewelry, then no Zakah is payable on that. I suspect this is the case because of the difference of price you have mentioned.
Bullion gold, i.e. gold that is neither coined nor manufactured, does not show such discrepancy between buying and selling.