Any such company may terminate its policies by publishing a notice of the time when they will terminate, and by giving or mailing a like notice to each party insured, 30 days at least before the time fixed for such termination, and by tendering to the insured under each policy a ratable proportion of the premium.