UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1RbYNJnB6Y3A8/P8gUXdM9MzwvwHGJZZiOqrKEwTqiY=' 
WHERE 
  key_id = '39a9bb761fd9726210c7d07ca6216049287be9d7b164a4ff348b391e423afeb7' 
  AND (
    token = '1RbYNJnB6Y3A8/P8gUXdM9MzwvwHGJZZiOqrKEwTqiY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017