UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49oSu8+1b8tdNqopzJqrMEwOj6h1DM8VxMqeoV2BdzM=' 
WHERE 
  key_id = '49117fec657ca83489f3a39ef968ff1dc40cf3eb383dc8f1a41f0bdc664160d6' 
  AND (
    token = '49oSu8+1b8tdNqopzJqrMEwOj6h1DM8VxMqeoV2BdzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028