UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lT29JTGwrGYlKwv7X7blmrNiJtNG6su7yPOquRyt/kE=' 
WHERE 
  key_id = '5729e29a80fe2503cf4116b332b77e8d6faea2f1dab817db8c17f3a8aa4a4f42' 
  AND (
    token = 'lT29JTGwrGYlKwv7X7blmrNiJtNG6su7yPOquRyt/kE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033