I haven't heard of Command-Query-Separation(CQS) before, but it seems that it would relate to Single Responsibility Principle(SRP), which states that a function/class ideally should be responsible for doing one thing and one thing only.
If your command code is 20 lines of code and query code is another 30 lines and they are all in one function body, clearly you are violating SRP and I'd assume CQS as well and those two pieces of logic should be separated from each other.
However, going with your hypothetical example, I would most likely create a wrapper method that would combine your command and query so that DRY isn't violated in numerous places in the code. I'd also wouldn't consider this to be SRP (and maybe CQS) violation, because the wrapper still has only one responsibility: to combine command with a query and create a higher level abstraction that is easier to consume.
I think wrapper method is perfectly acceptable solution and to illustrate that, let's take your example one step further. What if you had to run 2 queries instead of 1 and then do a command action based on that. So your 2 lines of code would be 6 or 8. What if there was some data validation/checking between one and the other, so now you have 15 lines of code. Would you think twice about creating a wrapper that does all that, rather than sprinkling those 15 lines in multiple files?