def METHOD_NAME(self, otp: OTP) -> bool:
    # SECURITY: This method must not run concurrently, otherwise there could be TOCTOU errors,
    # resulting in an OTP being used twice.
    with self._otp_read_lock:
        try:
            otp_is_used = self._otp_repository.otp_is_used(otp)
            # When this method is called, that constitutes the OTP being "used".
            # Set it as used ASAP.
            self._otp_repository.set_used(otp)
            if otp_is_used:
                return False
            if not self._otp_ttl_elapsed(otp):
                return True
            return False
        except UnknownRecordError:
            return False