The boards of county commissioners in the several counties of the state are authorized and empowered to care for the feeding and guarding of the prisoners confined in the jail of any such town or village and to pay out of the county treasury to the trustees of such town or village for the feeding and guarding of such prisoners.