UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TAILKr0VIlAWvK0rueJZo5CkGcY6KwkTWtR3LI8c+s0=' 
WHERE 
  key_id = '1c43d4f1aed83c39b78233ea1e75ef807554452ad19649c0f38fdf9ebb7c62e1' 
  AND (
    token = 'TAILKr0VIlAWvK0rueJZo5CkGcY6KwkTWtR3LI8c+s0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035