Nonequilibrium spin glass state in optical systems with coherence