You can also start from your selection and save it into a new table 'test' :
SELECT cartodb_id,
ST_Transform(ST_Buffer(the_geom::geography,400)::geometry, 3857) as the_geom_webmercator
INTO test
FROM set_of_points
then you can try this SQL operations (which seem to be easier) :
I start with this layer :

A Get intersection union :
--create all intersections with table test
DROP TABLE IF EXISTS intersection;
SELECT a.cartodb_id as id_a, b.cartodb_id as id_b, st_intersection(a.geom, b.geom) AS geom_intersection
INTO intersection
FROM test a, test b;
--delete auto_intersection with id (cartodb_id)
DELETE FROM intersection WHERE id_a = id_b;
-- create table intersection_union
DROP TABLE IF EXISTS intersection_union;
SELECT st_union(geom_intersection) AS geom INTO intersection_union FROM intersection
;
result :

B Get Difference :
-- get difference
DROP TABLE IF EXISTS difference;
SELECT st_difference(a.geom, b.geom) AS geom_difference
INTO difference
FROM test a, intersection_union b ;
result :

C get final layer:
--create the final geom with difference and intersection_union
DROP TABLE IF EXISTS final_shape;
CREATE TABLE final_shape AS
(
select st_union(iu.geom) AS geom FROM intersection_union iu
UNION
select d.geom_difference as geom FROM difference d
);
result :

You just get a geometry you can then update with cartodb_id