Where the term of office of the sheriff or deputy who made the sale expires within 20 days thereafter, and before executing the certificate required by law, that sheriff or deputy may execute and acknowledge the same in like manner and with like effect as if the term had not expired.