Mind your p's and q's cubed

Find the sum of all primes $q<1000$ such that for some prime $p, both $q$ divides $p^3-1$ and $p$ divides $q^3-1$.

×