I have heard folks on this forum state that WD-40 should not be used in locks.
However, last year, I had a master locksmith doing some work in my house, and I asked him this question.
His response was that WD-40 is fine to use in locks.
But, he advised me to stay with one product, rather than switching back & forth. He is of the opinion that using both WD-40 & graphite will "gum-up" a lock, but that using just graphite or just WD-40 is fine.