UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3bkbhQfgPmHogAkyERjF/9PjBXl5SEyrWsh3wzrGbjk=' 
WHERE 
  key_id = '2dee0b3f3fbb38516ee99b913c1090e54657b8d44b062a405afe496d9808b3c1' 
  AND (
    token = '3bkbhQfgPmHogAkyERjF/9PjBXl5SEyrWsh3wzrGbjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029