UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C75R09FhV8uJYFf8JE1tTfhcKzTDYclNogPHYJvdfAU=' 
WHERE 
  key_id = '486952c0dd8023e5ed15c33024df36dd9db6fcf2c7eff443467c2adb741507ec' 
  AND (
    token = 'C75R09FhV8uJYFf8JE1tTfhcKzTDYclNogPHYJvdfAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047