public static function sentOrLockedCount($minutes)
{
$table = ipTable('email_queue');
$sql = "select count(*) as `sent` from {$table} where\n (`send` is not NULL and " . ipDb()->sqlMaxAge('send', $minutes, 'MINUTE') . ")\n or (`lock` is not NULL and send is null) ";
return ipDb()->fetchValue($sql);
}