MySQL accounting stop query