Guatemala has declared a 30-day state of emergency after prison riots led to coordinated gang attacks.