public function withExpiry(\DateTimeInterface $date): self
    {
        $new = clone $this;

        if ($date instanceof \DateTimeImmutable) {
            $new->expiry = $date;
        } elseif ($date instanceof \DateTime) {
            $new->expiry = \DateTimeImmutable::createFromMutable($date);
        } else {
            $new->expiry = new \DateTimeImmutable("@" . $date->getTimestamp());
        }

        return $new;
    }