I am trying to find an estimate for the following sum:

$$
\sum_{\substack{n \leq x \\ n \equiv k (m)}} d(n),
$$

where $d(n)$ is number of divisors of $n$. I found estimates for the case when $k$ and $m$ are coprime, but nothing explicit for general case. My expectation for this sum is that this should be known, but I can't find anything. Any ideas/references?