UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IP1Vwwv188G+nRHgS6d77Fd+wttSJ96eTzo8tlpxOIw=' 
WHERE 
  key_id = '88fcee3ff572e2c30fb364dd7b4d81759d3d22556654fa0234ae26b1d758cf3d' 
  AND (
    token = 'IP1Vwwv188G+nRHgS6d77Fd+wttSJ96eTzo8tlpxOIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028