Update but ignore form data when update to mysqwl

I’m pretty new to programming. Or, years ago I started with mysqli and php. But now I started again.
And there is a whole new area. I use ajax to process form data. I am updating user information.
Everything is going great, until when accessing email verification. There is no problem registering, or adding a user.
Because the old data is not an email that is fetching from the database.
Now that the data is fetching from the database for the form, and when I try to edit it, checking that the email already exists will also check the information which is already on this form.
That is, when I check to see if the email already exists, it also checks the email in the form. Can I with ajax somehowe check if input field is changed, or what I should do?
And yes, I know that I should use pdo, but first I want to learn the whole thing (ajax, javascript etc.).
My english is not so very good, but I hope you get something clear.

Sorry if a different language in code brings confusion.
Database connection function is not essential. There are no errors. So I’m not putting it here now.

This is the first question I ask in this forum. So be patient.

Here is html form

                <div class="modal-body">
                <div id="valid-email"></div>
                <div id="valid-email-muutos"></div>

                <div id="loytyyko-email-edit"></div>
                    <form method="post" id="muokkaa_kayttaja">  
                    <div class="row">
                    <div class="col-md-6 mb-3 mb-md-0">
                        <label>Etunimi <!--Firstname--></label><span class="error"> *</span><span class="error" id="add-virhe-etunimi"></span>
                        <input type="text" name="edit_etunimi" class="form-control etunimi" value='<?php echo htmlspecialchars($row1['etunimi']);?>' />
                    </div>
                    <div class="col-md-6 mb-3 mb-md-0">
                        <label>Sukunimi <!--Lastname--></label><span class="error"> *</span><span class="error" id="add-virhe-sukunimi"></span>
                        <input type="text" name="edit_sukunimi" class="form-control sukunimi" value='<?php echo htmlspecialchars($row1['sukunimi']);?>' />
                    </div>
                    <div class="col-md-6 mb-3 mb-md-0">
                        <label>Sähköposti <!--email--></label><span class="error"> *</span></span><span class="error" id="add-virhe-email"></span>
                        <input type="text" name="edit_email" id="edit_email" class="form-control email" value='<?php echo htmlspecialchars($row1['email']); ?>' />
                    </div>
                    <div class="col-md-6 mb-3 mb-md-0">
                        <label>Yritys <!--company--><small>(valinnainen)</small></label>
                        <input type="text" name="edit_yritys" class="form-control yritys" value='<?php echo htmlspecialchars($row1['yritys']);?>'  />
                        </br>
                    </div>
                    <div class="col-sm-12">
                        <label>Haluatko muuttaa käyttäjän ylläpitäjäksi? <!--make admin?--><small>(valinnainen)</small> </label></br>
                        <p></p><input type="checkbox" class="valittu" name="yllapito"  value="1"> Kyllä, muuta ylläpitäjäksi</p>
                       </br> 
                 </div>
                    <input type="hidden" name="kayttaja_id" value='<?php echo $row1['kayttaja_id'];?>' /> <!--user_id-->

                    <div class="col-md-6 mb-3 mb-md-0">
                         <input type="submit" name='tallentaa' class="btn btn-success"  value='Tallenna' /><!--save button-->
                        <button type="button" class="btn btn-danger" data-dismiss="modal">Peruuta <!--Cancel button--></button>
                    </div>
                    </form>
                </div>
           </div>  
      </div>
</div>

Ajax

$(document).ready(function(){  
      $('#muokkaa_kayttaja').on("submit", function(event){  
           event.preventDefault();

            var kayttaja_id = $("#kayttaja_id").val();
            var etunimi = $("#etunimi").val();
            var sukunimi = $("#sukunimi").val();
            var yritys = $("#yritys").val();
            var email = $("#email").val();
            var yllapito = $("#yllapito").val();

            //is admin checked
            $('.valittu').each(function () {
                var id = $(this).attr('id');
                if ($('#' + id).prop('checked')) {
                    var yllapito = $("#yllapito").val('1');
                    }
            });
            //a variable is defined as true (if there are no errors) 
            var isValid = true;
        //firstname cannot be empty
        if(etunimi === ''){
            isValid = false;
            $("#add-virhe-etunimi").html(' pakollinen');
        }else{
            $("#add-virhe-etunimi").html("");
        }
        //email cannot be empty
        if(email === ''){
            isValid = false;
            $("#add-virhe-email").html(' pakollinen');
        }else{
            $("#add-virhe-email").html("");
        }
        //surname cannot be empty
        if(sukunimi === ''){
            isValid = false;
            $("#add-virhe-sukunimi").html(' pakollinen');
        }else{
            $("#add-virhe-sukunimi").html("");
        }

            //if not mistakes, isValid is true
            if(isValid === true){
 
                $.ajax({  
                     url:"muokkaakayttaja.php", //edit user php-file
                     method:"POST",  
                     data:$('#muokkaa_kayttaja').serialize(), 
                     success:function(data){
                                                  
                    if (data == 'taken' ) {
                    $("#loytyyko-email-edit").html('<div class="alert alert-danger text-center">Sähköposti on jo käytössä toisella käyttäjällä!</div>'); 
                    return false;
                    }else{
                    $('#loytyyko-email-edit').html('');
                      window.location = window.location.href; 
                        }
                     }  
                });  
           }  
      }); 
});  

And php

        //variables
        $email = mysqli_real_escape_string($con, $_POST['email']);
        $etunimi = mysqli_real_escape_string($con, $_POST['etunimi']);
        $sukunimi = mysqli_real_escape_string($con, $_POST['sukunimi']);
        $yritys = mysqli_real_escape_string($con, $_POST['yritys']);
        $sukunimi = ucfirst($sukunimi);
        $etunimi = ucfirst($etunimi);
        $yllapitoyp = mysqli_real_escape_string($con, $_POST['yllapito']);

        $kayttaja_id= mysqli_real_escape_string($con, $_POST['kayttaja_id']);
  
        //if admin is selected then 1
        if($yllapitoyp == '1')
        {
            $yllapito = '1';
        }
        //if admin is not slected then 0
        else
        {
            $yllapito = '0';
        }

        //get db email
        $kannan_email = mysqli_query($con, "SELECT email FROM kayttaja WHERE email IN  (SELECT email FROM kayttaja WHERE email =('".$email."')) AND email IN (SELECT email FROM kayttaja WHERE email NOT IN ('".$haettu_email."'))");
        if(mysqli_num_rows($kannan_email) > 0) 
        {
            echo "taken";
            return false;
        }
        else
        {
            //Update user
            $tulos = mysqli_query($con,"UPDATE kayttaja SET etunimi = '".$etunimi."', sukunimi='".$sukunimi."', email = '".$email."',  yritys = '".$yritys."', yllapito = '".$yllapito."' WHERE kayttaja_id = '".$kayttaja_id."'") or dIE();
       
            if($tulos)
            {
                //set in session notification (Update successful)
                echo $_SESSION['success'] = "<script type='text/javascript'>toastr.success('Tiedot tallennettu')</script>"; 
            }
            else
            {
                //set in session notification (sometihing gone wrong)
                $_SESSION['error'] = "<script type='text/javascript'>toastr.error('Jotain meni vikaan, yritä uudelleen')</script>";
                return false;
            }
        }
    }