UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ywuyA1PTFPytxxkg6dlGId+CmFLaStjzxL+DKM0xIo=' 
WHERE 
  key_id = '6fc46216fd707c115bb3f6be9da54c0e712fe5eaa2e29f1d04c79fa8455ccd39' 
  AND (
    token = '9ywuyA1PTFPytxxkg6dlGId+CmFLaStjzxL+DKM0xIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027