UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tfHewBm/jgzavHvE8B9mzLSW9lHcOrmiGaeFQUuicgc=' 
WHERE 
  key_id = '9fe035d69f5f977127333b7de5c97c37a277ff4b83bb5532229fb3291e5b3227' 
  AND (
    token = 'tfHewBm/jgzavHvE8B9mzLSW9lHcOrmiGaeFQUuicgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082