UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ctCMfuWHlX6OeHgY/yVT9xzQBpG80QqLn+akXl7T4Eg=' 
WHERE 
  key_id = 'e7b67425dafef5ebbfebee1ee08eac0184994c474c6903719ea4740af92d38f1' 
  AND (
    token = 'ctCMfuWHlX6OeHgY/yVT9xzQBpG80QqLn+akXl7T4Eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030