UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kHGSqWzOm/aQohaQ80u/R6N0sYYsUJlJv5bfHagsBoc=' 
WHERE 
  key_id = '4e46d2d6c9d0353ac49bc3eb165c8bd160893a025ee2fd5ca83ada1e5adf28ba' 
  AND (
    token = 'kHGSqWzOm/aQohaQ80u/R6N0sYYsUJlJv5bfHagsBoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031