Checking if user owns child records (MySQL)
You need a Select with 2 joins:

SELECT c.id
FROM c
  INNER JOIN b ON b.id = c.parent_id
  INNER JOIN a ON a.id = b.parent_id
WHERE c.id in (1, 2, 3, 18, 329)
  AND a.user_id = 20 ;