UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ZiF3LKs0T4mDq2WRM2xowd8cUCeOM6+kk+zYZ/A27Q=' 
WHERE 
  key_id = '4251b8cfb7c7fb2f85e9029d514066add37aca94a5445b85bd0d4d2843be9f0b' 
  AND (
    token = '6ZiF3LKs0T4mDq2WRM2xowd8cUCeOM6+kk+zYZ/A27Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051