UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GMO0OuVkTGrChVlLI1ghygzAKVs5dYX5YkX7FuiP5X0=' 
WHERE 
  key_id = 'adf7531ee84b9b99a50789cab758385cec4048b2249397e15ac3a4f2f0cb7a53' 
  AND (
    token = 'GMO0OuVkTGrChVlLI1ghygzAKVs5dYX5YkX7FuiP5X0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042