If any such moneys have been paid into the state general fund and a claimant appears therefor, if the court upon consideration of the circumstances finds that such claim is valid and should be paid, in that event the state shall refund the same unto the claimant as required by the decree of court.