It should be safe to clear these tables.
I was getting a similar error in the Postgres version and I changed
the sweep_sessions function to
proc sec_sweep_sessions {} {
set db [ns_db gethandle log]
set ns_time [ns_time]
ns_db dml $db "
delete from sec_session_properties where session_id in
(select session_id from sec_sessions
where ${ns_time} - last_hit > [ad_parameter
SessionLifetime "" 176800])
"
ns_db dml $db "
delete from sec_sessions
where ${ns_time} - last_hit > [ad_parameter
SessionLifetime "" 176800]
"
ns_db releasehandle $db
}
so that the same time was used in both queries.