UPDATE akuz.T_CARD_NOTE
SET ReadyToBeSent = false
WHERE NOT EXISTS (
    SELECT 1 
    FROM akuz.T_EMDR_MESSAGE 
    WHERE T_EMDR_MESSAGE.CardNote = T_CARD_NOTE.MedicalRecordID 
      AND T_EMDR_MESSAGE.RegistrationState = 0
)
AND ReadyToBeSent = true;