UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+7Y45PZ8MJ4itRjww6eWEr1at3AiCrTYUSWvUtNvm3Y=' 
WHERE 
  key_id = 'fed7a2e5cd9dcebba2fe3b8a20bfb08865c4d64a13c8c7d34af991ab6b8effb3' 
  AND (
    token = '+7Y45PZ8MJ4itRjww6eWEr1at3AiCrTYUSWvUtNvm3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017