public function findValidOTP(
        $secret,
        $key,
        $window,
        $startingTimestamp,
        $timestamp,
        $oldTimestamp = Constants::ARGUMENT_NOT_SET
    ) {
        for (
            ;
            $startingTimestamp <= $timestamp + $this->getWindow($window);
            $startingTimestamp++
        ) {
            if (
                hash_equals($this->oathHotp($secret, $startingTimestamp), $key)
            ) {
                return $oldTimestamp === Constants::ARGUMENT_NOT_SET
                    ? true
                    : $startingTimestamp;
            }
        }

        return false;
    }