SELECT * FROM people
WHERE (first_name = :first_name or :first_name is null)
AND (last_name = :last_name or :last_name is null)
AND (age = :age or :age is null)
AND (sex = :sex or :sex is null)
Al pasar parámetros, proporcione null
para los que no necesitas.
Tenga en cuenta que para poder ejecutar una consulta de esta manera, emulation mode
para PDO debe estar ON