UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CgJfX7CJa2/LXaU4n5GV5HxNQYv9SBXEkZgaXwLMZEU=' 
WHERE 
  key_id = '0bf3319df44fbedfcd49c170ab35a6d2556388e55a2a80ec5d44c258bb4483b9' 
  AND (
    token = 'CgJfX7CJa2/LXaU4n5GV5HxNQYv9SBXEkZgaXwLMZEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020