UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rUCXxvJwXrUQzTt9tTNsKV0FBmHUu4JtkcXFf6S8qLw=' 
WHERE 
  key_id = 'f3ae1debf672119693d287bc7506e5c7cd869cbf879820cac7d4d7734d186292' 
  AND (
    token = 'rUCXxvJwXrUQzTt9tTNsKV0FBmHUu4JtkcXFf6S8qLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029