Here is a tokcycle solution that will work with or without [french]{babel} loaded. If not loaded, it intercepts the normal : in the Character directive. If loaded, it must intercept it in the Macro directive.
Just surround the desired test area with \subcoloneqq...\endsubcoloneqq. That can start right after \begin{document} and end right before \end{document}.
See SUPPLEMENT for FUTURE improvement.
\documentclass{article}
\usepackage{tokcycle,mathtools}
\usepackage[french]{babel}
\def\coltype{}
\newcommand\notcoleq{\ifcolon\addcytoks[1]{\coltype}\fi\colreset}
\newcommand\colreset{\colonfalse\def\coltype{}}
\newif\ifcolon
\stripgroupingtrue
\tokcycleenvironment\subcoloneqq
%%% CHARACTER DIRECTIVE
{%
\tctestifx{=##1}
{\tctestifcon{\ifcolon}
{\addcytoks{\coloneqq}\colreset}
{\notcoleq\addcytoks{##1}}%
}
{\tctestifx{:##1}
{\colontrue\def\coltype{##1}}
{\notcoleq\addcytoks{##1}}%
}%
}
%%% GROUP DIRECTIVE
{\notcoleq\groupedcytoks{\processtoks{##1}\notcoleq}}
%%% MACRO DIRECTIVE
{\tctestifcon{\if\detokenize{:}\detokenize{##1}}
{\colontrue\def\coltype{##1}}
{\notcoleq\addcytoks{##1}}}
%%% SPACE DIRECTIVE
{\notcoleq\addcytoks{##1}}
%%%
\begin{document}
\subcoloneqq
Un example: et voilà.
$a := b$ $a \ordinarycolon= b$ $a:b$
\endsubcoloneqq
\end{document}

SUPPLEMENT
I have recently began a tokcycle package improvement cycle to add look-ahead features to the token cycle. In the above "standard" approach, only one token is handled in the input stream at a time. Therefore, to look for a multi-byte sequence, I have to set flags and macros, so that one directive can communicate with another.
EDIT: tokcycle[2021-05-27] has been released which incorporates code to peek ahead at the input stream. Thus, \makeatletter code has been excised from this supplement. As you can see, the directives of the \subcoloneqq environment become greatly simplified.
\documentclass{article}
\usepackage{tokcycle,mathtools}
\usepackage[french]{babel}
\newcommand\coleqchek[1]{\tcpeek\z
\ifx=\z\tcpop\z\addcytoks{\coloneqq}\else\addcytoks{#1}\fi}
\tokcycleenvironment\subcoloneqq
%%% CHARACTER DIRECTIVE
{\tctestifx{:##1}{\coleqchek{##1}}{\addcytoks{##1}}}
%%% GROUP DIRECTIVE
{\processtoks{##1}}
%%% MACRO DIRECTIVE
{\tctestifcon{\if\detokenize{:}\detokenize{##1}}
{\coleqchek{##1}}{\addcytoks{##1}}}
%%% SPACE DIRECTIVE
{\addcytoks{##1}}
%%%
\begin{document}
\subcoloneqq
Un example: et voilà.
$a := b$ $a \ordinarycolon= b$ $a:b$
\endsubcoloneqq
\end{document}
\def{:=}{\coloneqq}. – Colas Mar 31 '21 at 13:26