The proceeds of any sale of land bid in and acquired pursuant to chapters 10-23, 10-25, and 10-26, after deducting the expenses incurred by the county in the proceedings to take tax deed and in such sale proceedings, shall be placed to the credit pro rata of the various funds and taxing districts which are the beneficiaries of the tax for the year for which such property was sold at tax sale; provided, however, that it shall be lawful for the county treasurer, in his discretion, to distribute the proceeds received from the sale of any property under the provisions hereof by prorating such proceeds on the basis of the levy for any one year the taxes of which are included in the proceeds of such sale, taking the year which represents the more equitable basis for such distribution.
SDCL 7-31-31