Virus-driven evolution of an antiviral gene in deep and shallow time