SELECT
	C.*, E.start_at, E.event_status, L.name AS 'location', E.name
FROM
	contests AS C, events AS E, locations AS L
WHERE
	C.event = E.id
AND 
	E.location = L.id
AND 
	C.activity IN ('BBX', 'GBX')

UNION

SELECT
	C.*, E.start_at, E.event_status, E.location, E.name
FROM
	contests AS C, events AS E
WHERE
	C.event = E.id
AND 
	C.activity IN ('BBX', 'GBX')

