Closed bracket in mysql query