UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'im8+jLPUH/cxXjRosmIz9oUylvhm8vljGO5m1lO1moc=' 
WHERE 
  key_id = '52d8803cf616fa3d2f0da43b303aa1154eac8fb67e7ffec0b74be6804c911f9e' 
  AND (
    token = 'im8+jLPUH/cxXjRosmIz9oUylvhm8vljGO5m1lO1moc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019