UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qQVyiYwy8hRzLoJjzP1T4/8iZZ9cCzSZfT2u16R5pJw=' 
WHERE 
  key_id = '0d20f15189c8d8e715f365ae30705fe45099bf292f3b42e21eb629fadce3c72d' 
  AND (
    token = 'qQVyiYwy8hRzLoJjzP1T4/8iZZ9cCzSZfT2u16R5pJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038