From a proof I have reason to believe the following inequality holds

$\displaystyle \displaystyle \sum_{\substack{ p\leq x \\ p| q}} 1 \ll \log q$

where p signifies summing only over primes. But I cannot prove it.

(The full argument used is: $\displaystyle \displaystyle \sum_{\substack{ p\leq x \\ p| q}} \bigg[\frac{\log x}{\log p}\bigg]\log p \ll (\log x)\log q$ )