UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T21WMJ5mr38txY/9xFwW7b0WlabiaiEUeAFrwVIHq3g=' 
WHERE 
  key_id = '5db67e14fbb3b77c294c21d5f98d55f35124efb5ec0e4342ebf816390c058c5c' 
  AND (
    token = 'T21WMJ5mr38txY/9xFwW7b0WlabiaiEUeAFrwVIHq3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023