UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PaOdSmx7ePdgyZKgv/lxNgQ64Db+7T8nTuEjFOGHq30=' 
WHERE 
  key_id = 'd96a339030eaa4fff7aeb8fc4b206dda7888141f3d118cca2cb410dd2271dd03' 
  AND (
    token = 'PaOdSmx7ePdgyZKgv/lxNgQ64Db+7T8nTuEjFOGHq30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037