title: Users queue in mysql
body: <p>I'm trying to create queues table</p>
  
  <pre><code>id | queue_id | user_id | is_active_to_vote
  1  | 14       | 1       | 1
  2  | 14       | 2       | 0
  3  | 14       | 3       | 0
  4  | 15       | 1       | 1
  5  | 15       | 2       | 0
  6  | 15       | 3       | 0
  </code></pre>
  
  <p>the users list in result  looks like this (for queue_id=14)</p>
  
  <pre><code>Sam (user_id=1 votes now)
  John (user_id=2)
  Bill (user_id=3)
  </code></pre>
  
  <p>But if user did not vote in time I need to resort the queue like this</p>
  
  <pre><code>John (user_id=2 votes now)
  Bill (user_id=3)
  ...
  Sam (user_id=1 last user in queue)
  </code></pre>
  
  <p>What is the good way to do this?</p>