Conditional Counting
If you want to return both the total number of logins and the total number of sessions that are less than 10 minutes, then you can get the result using your current query with some minor changes.

You can move the where clause filter inside of a CASE expression to get the count of the sessions less than 10 minutes. Then just add a second count() to get the total number of sessions for each username.

select username, 
  count(case when duration&lt;=600 then username end) as `&lt;= 10 min`,
  count(username) TotalLogins
from logins
group by username
order by username asc
limit 10;


See SQL Fiddle with Demo.  You could also use the MySQL shorthand IF() syntax instead of the CASE expression:

select username, 
  count(if(duration&lt;=600, username, null)) as `&lt;= 10 min`,
  count(username) TotalLogins
from logins
group by username
order by username asc
limit 10;


See SQL Fiddle with Demo. Both queries will give a result:

| USERNAME | &lt;= 10 MIN | TOTALLOGINS |
|    user1 |         4 |           6 |
|    user2 |         3 |           4 |
|    user3 |         1 |           5 |
|    user4 |         4 |           9 |