I was interested in the following question, which I am not sure if it is true or not. I would appreciate any answers or references. Thank you! (Please note this is the revised version of the original question asked as pointed out by the comments of Mr/Ms The Masked Avenger)

Suppose I have real numbers $0 < \theta < \gamma < 1$. Does there exist some absolute constant $C> 0$ such that the following holds for $X$ sufficiently large?: If $X > q > X^{\gamma}$, then we can find $ X^{\theta}/ \log X < k < X^{\theta}\log X$ such that $q \equiv r (\text{mod }k)$ and $0 \leq r \leq C \log X$. (or possibly the same statement where we replace $\log X$ with $X^{\epsilon}$)