If the assessment is unpaid, the credit shall be applied upon the earliest unpaid installment or installments of principal and interest and any excess over the total principal and interest remaining unpaid shall be returned as provided in Section 31829.